<?php
	include_once 'isLogin.php';
	$servicec=new service(); //服务类
	$id=$_GET['id'];
	$table_comment="zs_service_comment";	//评论表


	if($_GET['action']=='del'){
		$del_id=$_POST['del_id'];
		echo $commonc->del($table_comment,$del_id.',');
		exit;
	}


	if($id!='' && $id!=null){
		//用户评论  
		$where=' and a.service_id="'.$id.'"';
		$key="a.*,u.account,u.avatar,u.id as u_id,u1.account as account1,u1.avatar as avatar1,u1.id as u_id1";

		$comment=$servicec->serviceComment($where,$key);
		$comment=$comment['result'];
		for ($i=0; $i <count($comment) ; $i++) { 
			@$comment[$i]['create_time']=date('Y-m-d H:i:s',$comment[$i]['create_time']);
		}
	}
	$smarty->assign('comment',$comment);

	$smarty->display("service_comment.html");
?>